package cn.han.oop;
//代码复写
public class TestPhone2 {
    public static void main(String[] args) {
//4.在main中创建Phone2类中的对象phone2与phone3
        Phone2 phone2 = new Phone2();
        Phone2 phone3 = new Phone2();
        //5.给对象的两个属性设置值
        phone2.brand = "xiaomi";
        phone2.price = 9999.99;
        //6.查看对象的两个属性值
        System.out.println(phone2.brand);
        System.out.println(phone2.price);
        System.out.println(phone3.price);
        System.out.println(phone3.brand);
        //7.通过对象调用play（）
        phone2.play();
    }
}
class Phone2 {//1.创建手机类
    //2.定义手机类的属性，成员变量
    String brand;
    double price;
    //3.定义手机类的功能，方法
    public void play(){
        System.out.println("正在玩手机");
    }
}
